home *** CD-ROM | disk | FTP | other *** search
- function createSmall()
- {
- cursmall = attachMovie("small","enemy" + n,n);
- n++;
- n <= 50 ? null : (n = 0);
- cursmall._x = 800;
- cursmall._y = 25 + random(301);
- cursmall.xspd = beeSpd + 8 + random(4);
- cursmall.yspd = Math.random() * 6 - 3;
- cursmall.grav = 0;
- cursmall.onEnterFrame = beeMove;
- }
- function createMedium()
- {
- curmedium = attachMovie("medium","enemy" + n,n);
- n++;
- n <= 50 ? null : (n = 0);
- curmedium._x = 800;
- curmedium._y = 25 + random(301);
- curmedium.xspd = beeSpd + 6 + random(3);
- curmedium.yspd = Math.random() * 4 - 2;
- curmedium.grav = 0;
- curmedium.onEnterFrame = beeMove;
- }
- function createBig()
- {
- curbig = attachMovie("big","enemy" + n,n);
- n++;
- n <= 50 ? null : (n = 0);
- curbig._x = 900;
- curbig._y = random(301) + 25;
- curbig.xspd = beeSpd + 4 + random(2);
- curbig.yspd = Math.random() * 2 - 1;
- curbig.grav = 0;
- curbig.onEnterFrame = beeMove;
- }
- function createShooter()
- {
- curshooter = attachMovie("shooter","enemy" + n,n);
- n++;
- n <= 50 ? null : (n = 0);
- curshooter._x = 800;
- curshooter._y = random(275) - 100;
- curshooter.xspd = 10;
- curshooter.yspd = Math.random() * -6 - 3;
- curshooter.shooter = true;
- curshooter.onEnterFrame = beeMove;
- }
- function createStinger(a, b)
- {
- curStinger = attachMovie("stinger","stinger" + s,s);
- s++;
- s <= 600 ? null : (s = 500);
- curStinger._x = a;
- curStinger._y = b;
- curStinger.xspd = 15;
- curStinger.onEnterFrame = beeMove;
- }
- function createHealth()
- {
- curHealth = attachMovie("health","health" + n,n);
- n++;
- n <= 50 ? null : (n = 0);
- curHealth._x = 750;
- curHealth._y = Math.random() * 350 + 25;
- curHealth.xspd = Math.random() * 5 + 3;
- curHealth.health = true;
- curHealth.onEnterFrame = beeMove;
- }
- function createCoin()
- {
- curCoin = attachMovie("coin","coin" + c,c);
- c++;
- c <= 200 ? null : (c = 100);
- curCoin._x = 750;
- curCoin._y = Math.random() * 350 + 25;
- curCoin.coin = true;
- curCoin.xspd = 7 + Math.random() * 6;
- curCoin.onEnterFrame = beeMove;
- }
- function beeMove()
- {
- if(_currentframe != 6)
- {
- this.removeMovieClip();
- }
- if(this._x < -300 || this._y > 600)
- {
- this.removeMovieClip();
- }
- this._x -= this.xspd;
- this._y -= this.yspd;
- this.yspd -= this.grav;
- if(this.coin == true)
- {
- if(this.hitTest(_root.bee) && this._currentframe < 12)
- {
- this.gotoAndPlay(12);
- }
- if(this._currentframe == 21)
- {
- score += 200;
- burst(this._x,this._y,3);
- this.removeMovieClip();
- }
- }
- if(this.shooter == true)
- {
- this.xspd = Math.ceil((this._x - 600) / 5);
- this.yspd = - this.xspd;
- if(this._currentframe == 91)
- {
- this.removeMovieClip();
- }
- if(this._x <= 550)
- {
- this.play();
- }
- if(this._currentframe == 13)
- {
- createStinger(this._x,this._y);
- }
- }
- if(this.health == true)
- {
- if(this.hitTest(_root.bee) && this._currentframe == 1)
- {
- this.play();
- }
- if(this._currentframe == 17)
- {
- if(_root.bee.health < 11)
- {
- _root.bee.health = _root.bee.health + 1;
- }
- else
- {
- score += 200;
- }
- burst(this._x,this._y,4);
- this.removeMovieClip();
- }
- }
- }
- function burst(a, d, c)
- {
- i = 0;
- while(i < 15)
- {
- curStar = attachMovie("bstar","star" + b,b);
- b++;
- b <= 400 ? null : (b = 300);
- curStar.gotoAndStop(random(c) + 1);
- c != 10 ? null : curStar.gotoAndStop(random(2) + 4);
- curStar._xscale = 50 + random(101);
- curStar._yscale = curStar._xscale;
- curStar._x = a;
- curStar._y = d;
- curStar.xspd = Math.random() * 10 - 5;
- curStar.yspd = Math.random() * 10 - 3;
- curStar.grav = 0.5;
- curStar.onEnterFrame = beeMove;
- i++;
- }
- }
- n = 0;
- b = 300;
- c = 100;
- s = 500;
- xspd = 0;
- yspd = 0;
- grav = 0;
- score = 0;
- realScore = 0;
- counter = 5;
- cCounter = 150;
- hCounter = 400;
- shCounter = 250;
- sCounter = 100;
- mCounter = 200;
- bCounter = 300;
- shooter = false;
- heatlh = false;
- beeSpd = 0;
- onEnterFrame = function()
- {
- burstCounter--;
- if(_currentframe == 6)
- {
- n <= 50 ? null : (n = 0);
- if(realScore < score)
- {
- realScore += 1 + Math.floor((score - realScore) / 10);
- }
- if(counter <= 1 && _root.bee.health > 0)
- {
- score += 5;
- counter = 5;
- }
- if(sCounter <= 0)
- {
- createSmall();
- sCounter = Math.max(250 + random(40) - Math.abs(score / 30),20);
- }
- if(mCounter <= 0)
- {
- createMedium();
- mCounter = Math.max(275 + random(55) - Math.abs(score / 35),25);
- }
- if(bCounter <= 0)
- {
- createBig();
- bCounter = Math.max(300 + random(60) - Math.abs(score / 40),30);
- }
- if(shCounter <= 0)
- {
- createShooter();
- shCounter = Math.max(285 + random(55) - Math.abs(score / 38),28);
- }
- if(hCounter <= 0)
- {
- createHealth();
- hCounter = 350 + random(100);
- }
- if(cCounter <= 0)
- {
- createCoin();
- cCounter = 125 + random(50);
- }
- if(beeSpd < 20)
- {
- beeSpd = Math.floor(realScore / 1150);
- }
- counter--;
- cCounter--;
- hCounter--;
- shCounter--;
- sCounter--;
- mCounter--;
- bCounter--;
- _root.bg.gotoAndStop(Math.ceil(realScore / 10) - Math.floor(realScore / 5000) * 500);
- }
- };
-